package com.xiangge.domain;

import java.util.Objects;

public class StudentImpl {
    private String name;
    private int age;
    private int id;
    private String sex;

    public void study(){
        System.out.println("学习");
    }
    public void sleep(){
        System.out.println("睡觉");
    }
    public void eat(){
        System.out.println("吃饭");
    }
    public static int sum(int num1, int num2) {
        return num1 + num2;
    }

    public StudentImpl() {
    }
    public StudentImpl(String name, int age, int id, String sex) {
        this.name = name;
        this.age = age;
        this.id = id;
        this.sex = sex;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    @Override
    public String toString() {
        return "Test51Impl{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", id=" + id +
                ", sex='" + sex + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        StudentImpl test51 = (StudentImpl) o;
        return age == test51.age &&
                id == test51.id &&
                Objects.equals(name, test51.name) &&
                Objects.equals(sex, test51.sex);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, age, id, sex);
    }
}
